package test;

import java.util.Scanner;

public class Aiqiyi1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        System.out.println(getZeroNum(String.valueOf(getRes(input))));
        System.out.println(getRes1(input));
    }

    private static int getRes1(int input) {
        int count = 0;
        for (int i = 1; i <= input; i++) {
            count += isLegal(i);
        }
        return count;
    }

    private static int isLegal(int num) {
        String strNum = String.valueOf(num);
        int count = 0;
        for (int i = strNum.length() - 1; i >= 0 ; i --) {
            if (strNum.charAt(i) == '0'){
                count ++;
            }else {
                if (strNum.charAt(i) == '5'){
                    count ++;
                    return count;
                }else {
                    break;
                }
            }
        }
        return count;

    }

    private static int getZeroNum(String str) {
        int count = 0;
        for (int i = str.length() - 1; i >= 0; i--) {
            if (str.charAt(i) == '0'){
                count++;
            }else {
                break;
            }
        }
        return count;
    }

    private static long getRes(int input) {
        if (input < 2){
            return input;
        }
        long sum = 1;
        for (int i = 2; i <= input; i++) {
            sum *= i;
        }
        return sum;
    }

}
